package PhamVanHien;
import java.util.Scanner;
public class Exam {
   
	public static void main(String[] args) {        
        System.out.print(" Gia tri n = ");
        Scanner sr = new Scanner(System.in);
        int n = sr.nextInt();
        for (int i=1;i<=n;i++){   
            int iCounter =0;
            for (int j=1;j<=(i/2);j++){  
if(i%j==0){         iCounter =  iCounter +j;
                    if(iCounter==i){           System.out.println(i); }   }   }   }   }


}

